
<include file="__THEME__/public_header"/>
<link href="__APP__/friend.css" type="text/css" rel="stylesheet">

<div class="main">
    <include file="_nav"/>
    <!--人脉导航-->


    <ul class="list">
        <li id="one" ><a class="a" href="{:U('friend/Index/_one_connection')}" >一度人脉(<span class="onecount" id="one_count">{$one_count}</span>)</a>
        </li>
        <li id="two"><a class="a"  href="{:U('friend/Index/_two_connection')}">二度人脉(<span class="twocount" id="two_count">{$user1.count}</span>)</a>
        </li>
    </ul>
    <div class="clearfix"></div>
<div style="width: 745px;">

<volist name="user1['data']" id="vo" offset="0" length='1'>
    <div style="width: 360px;height: 145px;border: 1px #dd4b39 solid;float: left;margin-right: 10px;">
        <div style="float: left">
            <img title=" {$vo.name}" src=" {$vo.head}">
        </div>
        <div style="float: left">
            <div>

                {$vo.name}
            </div><div>
            学校： {$vo.school.0.school_name}</div>
            <div>
                现居： {$vo.now_cityname}
            </div>
            <div>
                家乡： {$vo.home_cityname}
            </div>
            <div>
                       共有<a onclick="samefriend('{$vo.uid}')" class="a">{$vo.same_count}</a>位共同好友
                <div class="clearfix"></div>
                <volist name="vo.same" id="v">

                    <div style="float: left">
                        <img title="{$v.name}" src=" {$v.avatar_tiny}">
                    </div>
               </volist>

            </div>
            <div class="clearfix"></div>
            <div>
                <a  onclick="addfriend('{$vo.uid}')" style="cursor: pointer" >请求加为好友</a>
            </div>
        </div>


    </div>


</volist>
    <div>{$user1.html}</div>
</div>

</div>
<include file="__THEME__/public_footer"/>

<script>
    function samefriend(id){
        location.href = U('friend/Index/samefriendList'+'&id='+id);
    }
    function addfriend(fid){
        $.post(U("friend/Index/friend_apply"), {fid:fid}, function (data) {
            if(data.data == 1){
                ui.error('不能添加自己！')
            }
            if(data.status == 1){
                ui.success('消息已经发出！')
            }
            else{
                ui.error('重复添加');
            }
        }, 'json');
    }



</script>